package com.insist.dao;

import com.insist.entity.ProductInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by Administrator on 2015/11/6.
 */
public interface ProductInfoDao extends JpaRepository<ProductInfo,Long>,JpaSpecificationExecutor<ProductInfo> {

    List<ProductInfo> findByIsRecommend(Boolean isRecommend);

    List<ProductInfo> findByIsRecommendAndIsShow(Boolean isRecommend, Integer isShow);

    @Query("select max(o.productNo) from ProductInfo o")
    String getMaxProductNo();
}
